package com.wsh.dto.work;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wsh.dto.BaseDto;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
* @author 王思涵
* @date 2020-02-29
*/
@Data
public class StudentTestDto extends BaseDto implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 学生姓名 */
    @NotBlank(message = "学生姓名不能为空")
    @Length(max = 16, min = 2, message = "学生姓名长度不正确")
    @Pattern(regexp = "(?:[\u4e00-\u9fa5·]{2,16})", message = "学生姓名格式不正确")
    private String name;

    /** 性别 */
    @NotNull(message = "性别不能为空")
    private Integer sex;

    /** 主键 */
    private String id;

    /** 生日 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "生日不能为空")
    private Date birthday;

    /** 个人详情 */
    @NotBlank(message = "个人详情不能为空")
    private String detail;

    private String beforeBirthday;

    private String afterBirthday;


}
